<?php
$this->Html->addCrumb('Offices');
echo $this->Html->script('JQueryOffices'); ?>

<div class="modal fade hide" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button>
			<h3 id="myModalLabel">New Office</h3>
		</div>
		<div class="modal-body">
        <p style="text-align:center;"><img src="img/loading.gif" id="loading-indicator" /><br />Loading Please Wait</p>
		</div>
		
</div>
<div class="officesIndex">
	<h2><?php echo __('Offices'); ?><?php echo $this->Html->link($this->Html->image('buttons/add-button-50px.png', array(
															'alt'=>'Add',
																)
															), array('action' => 'add'), array('data-toggle' => 'modal', 'data-target' => '#addModal', 'escape' => false)); ?></h2>
	<table class="table table-condensed" cellpadding="0" cellspacing="0" id="data">
	<thead>
		<tr>
				<!--<th><?php echo $this->Paginator->sort('o_id'); ?></th>-->
				<th><?php echo $this->Paginator->sort('o_name', 'Office Name'); ?></th>
				<!--<th><?php echo $this->Paginator->sort('o_address', 'Address'); ?></th>-->
				<th><?php echo $this->Paginator->sort('o_postcode', 'Postcode'); ?></th>
				<th><?php echo $this->Paginator->sort('o_phone', 'Phone Number'); ?></th>
				<th><?php echo $this->Paginator->sort('o_email', 'Email Address'); ?></th>
				<th class="actions"><?php echo __('Actions'); ?></th>
		</tr>
	</thead>
	<tbody>
		<?php foreach ($offices as $office): ?>
		<tr>
			<!--<td><?php echo h($office['Office']['o_id']); ?>&nbsp;</td>-->
			<td><?php echo h($office['Office']['o_name']); ?>&nbsp;</td>
			<!--<td><?php echo h($office['Office']['o_address']); ?>&nbsp;</td>-->
			<td><?php echo h($office['Office']['o_postcode']); ?>&nbsp;</td>
			<td><?php echo h($office['Office']['o_phone']); ?>&nbsp;</td>
			<td><?php echo h($office['Office']['o_email']); ?>&nbsp;</td>
			<td class="actions">
				<?php echo $this->Html->image('buttons/view-button-35px.png', array(
																'alt'=>'View', 'url' => array('action' => 'view', $office['Office']['o_id']))); ?>
				<?php echo $this->Html->image('buttons/edit-button-35px.png', array(
																'alt'=>'Edit',
																'url'=> array('action' => 'edit', $office['Office']['o_id']))); ?>
				<?php echo $this->Form->postLink(
								$this->Html->image('buttons/delete-button-35px.png',array(
																	'alt'=>'Delete')
																), 
																array('action' => 'delete', $office['Office']['o_id']), array(
																'escape' => false,
																'confirm' => 'Are you sure you want to delete %s?', $office['Office']['o_name'])
																); ?>
			</td>
		</tr>
		<?php endforeach; ?>
	</tbody>
</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} of {:pages}')
	));
	?>	</p>
	<div class="paging">
	<?php
		// echo $this->Paginator->prev('< ' . __('Previous '), array(), null, array('class' => 'prev disabled'));
		// echo $this->Paginator->numbers(array('separator' => ''));
		// echo $this->Paginator->next(__(' Next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>
